home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / os2 / inadv095.zip / listini.cmd < prev    next >
OS/2 REXX Batch file  |  1996-10-07  |  2KB  |  60 lines

  1. /*
  2.  
  3.   REXX Script to list Internet Adventurer settings 
  4.  
  5.   Written by Juergen Hermann | http://www.schiele-ct.de/jh | IRC: SNIBRIL
  6.  
  7. */
  8.  
  9. if RxFuncQuery('SysLoadFuncs') then do
  10.    call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  11.    call SysLoadFuncs
  12. end
  13.  
  14. parse upper arg inifile
  15. if inifile = '' then do
  16.     say "Syntax: LISTINI <name>"
  17.     say "Where <name> = .INI name (or OS2) for OS2.INI"
  18.     say "Example: LISTINI OS2"
  19.     exit 1
  20. end
  21.  
  22. if inifile = 'OS2' then inifile = 'USER'
  23.  
  24. Z   = '00'x
  25. APP = "Internet Adventurer"
  26. say "/*" APP "settings in" inifile "("space(date(),1,'-') time()") */"
  27. say "Z = '00'x"
  28.  
  29. rc = SysIni(inifile, APP, 'All:', 'Keys')
  30. if rc \= 'ERROR:' then do
  31.     do i = 1 to Keys.0
  32.         val = SysIni(inifile, APP, Keys.i)
  33.  
  34.         if rc \= 'ERROR:' then do
  35.             if val = '' then val = '""'
  36.             else do
  37.                 valx = left(val, length(val)-1)
  38.                 valz = right(val,1)
  39.  
  40.                 if valz = Z & verify(valx, xrange('20'x,'7F'x) ,
  41.                         || 'äöüÄÖÜß') == 0 then
  42.                     val = quotify(valx)'Z'
  43.                 else 
  44.                     val = '"'c2x(val)'"x'
  45.                 say 'call SysIni' quotify(inifile)','  quotify(APP)',' ,
  46.                                   quotify(Keys.i)',' val
  47.                 end
  48.             end
  49.         else say "/* Can't get data or key" Keys.i "*/"
  50.         end
  51.     say '/* Listing complete */'
  52.     end
  53. else say "/* Can't get application keys */"
  54.  
  55. exit 0
  56.  
  57. quotify: procedure
  58.     return translate(space('"'translate(arg(1),'0120'x, '2022'x)'"', 2,'"'), ,
  59.                      ' ','01'x)
  60.